/**
 * FileFind - ftp/shares indexing and search php engine
 * Module: common
 * Description: Common classes
 * Copyright (c) 2003-2010 Rage Steel, www.gt2.ru
 */
package ru.ffind.common.model;

/**
 * Connection error causes.
 * FIXME Add method to get object by code.
 *
 * @author Rage Steel
 */
public enum ConnError {
    /**
     * Success.
     */
    SUCCESS(0),

    /**
     * Unable to resolve address by name.
     */
    UNABLE_TO_RESOLVE(1),

    /**
     * Unknown server type.
     */
    UNKNOWN_SERVER_TYPE(2),

    /**
     * Unable to connect.
     */
    UNABLE_TO_CONNECT(3),

    /**
     * FSA listing is absent.
     */
    FSA_LISTING_ABSENT(4),

    /**
     * FSA listing is out of date.
     */
    FSA_LISTING_OUTDATED(5),

    /**
     * Listing of server that not belong to current group is out of date.
     */
    OTHER_GROUP_LISTING_OUTDATED(6),

    /**
     * Unable to authenticate.
     */
    UNABLE_TO_AUTH(104),

    /**
     * Unable to get current directory.
     */
    UNABLE_TO_GET_CURDIR(105),

    /**
     * Unable to get system type.
     */
    UNABLE_TO_GET_SYSTYPE(106),

    /**
     * Unable to get directory contents.
     */
    UNABLE_TO_GET_DIR_CONTENTS(107),

    /**
     * Unable to get server contents.
     */
    UNABLE_TO_GET_SERVER_CONTENTS(108),

    /**
     * List of shared resources is empty.
     */
    SHARE_RES_LIST_IS_EMPTY(109),

    /**
     * Error parsing listing: unable to divide by directories.
     */
    ERROR_PARSING_LISTING(110),

    /**
     * Error loading root directory.
     */
    ERROR_LOADING_ROOT(111),

    /**
     * Error parsing root directory.
     */
    ERROR_PARSING_ROOT(112),

    /**
     * Session aborted.
     */
    SESSION_ABORTED(113);

    private final int code;

    private ConnError(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }
}
